package prolog.terms

class Int_(val nval: Long) extends Num {

  def name: String = { return "" + nval }

  override def bind_to(that: Term, trail: Trail): Boolean = {
    return super.bind_to(that, trail) && (nval.asInstanceOf[BigDecimal] == that.asInstanceOf[BigDecimal])
  }

  // unbelievable but true: converting
  // to double is the only way to convince
  // Microsoft's jview that 1==1
  // $$ casting to double to be removed
  // once they get it right

  final def longValue(): Long = {
    return nval
  }

  final def intValue(): Int = {
    return nval.asInstanceOf[Int]
  }

  override def getValue(): BigDecimal = {
    return nval
  }

}
